﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using TrainingsApp.Model;
using TrainingsApp.Helper;
using WisDragon.Framework.Data.DataAccess;

namespace TrainingsApp.DAL {
    public partial class Test_DAL {

        public static List<TestModel> ListAll(int pageSize, out int total) {

            total = 0;
            try {
                int tempRecord = 0;
                DataCommand cmd = DataCommandManager.GetDataCommand("Test_TS_Province_ListByPaging");
                cmd.SetParameterValue("@PageSize", pageSize);
                cmd.SetParameterValue("@RecordCount", tempRecord);
                List<TestModel> pageList = cmd.ExecuteEntityList<TestModel>();
                total = Convert.ToInt32(cmd.GetParameterValue("@RecordCount"));
                return pageList;
            }
            catch (Exception ex) {
                ExceptionHelper.ProcessException(ex);
            }

            return new List<TestModel>(0);
        }
    }
}
